#ifndef _MOTOR_H_
#define _MOTOR_H_

#include "stm32f4xx.h"

#define LEFTMOTOR  (0x00)
#define RIGHTMOTOR (0x01)

#define READREG    (0x0000)
#define WRITEREG   (0x0106)

void MotorInit(void);
void SendMessageToMotor(uint16_t instruct,
                        uint16_t reg,
                        uint16_t value,
                        uint8_t motor);
uint8_t MotorDriverTask(void);
void RobotRotationControl(uint16_t time, uint8_t dir, uint16_t rpm, uint8_t enable);
void MotorBreak(void);
void RefreshMotorSpeed(void);
void MotorSpeedup(uint16_t speed, uint8_t time);
void MotorSlowdown(uint16_t speed, uint16_t time);

#endif


